package com.baseweb.webadmin.core.model.mapper;

import com.baseweb.webadmin.core.model.pojo.ByUserWedBudget;
import com.baseweb.webadmin.core.model.pojo.ByUserWedBudgetExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

public interface ByUserWedBudgetMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_wed_budget
     *
     * @mbggenerated Fri Apr 21 00:08:10 CST 2017
     */
    int countByExample(ByUserWedBudgetExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_wed_budget
     *
     * @mbggenerated Fri Apr 21 00:08:10 CST 2017
     */
    int deleteByExample(ByUserWedBudgetExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_wed_budget
     *
     * @mbggenerated Fri Apr 21 00:08:10 CST 2017
     */
    @Delete({
        "delete from by_user_wed_budget",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_wed_budget
     *
     * @mbggenerated Fri Apr 21 00:08:10 CST 2017
     */
    @Insert({
        "insert into by_user_wed_budget (user_id, wed_type, ",
        "wed_time, ",
        "money, mobile, contact, ",
        "descn, status, create_time, ",
        "update_time, ",
        "city,province,district)",
        "values (#{userId,jdbcType=INTEGER}, #{wedType,jdbcType=VARCHAR}, ",
        "#{wedTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}, ",
        "#{money,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{contact,jdbcType=VARCHAR}, ",
        "#{descn,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}, ",
        "#{updateTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}, ",
        "#{city,jdbcType=VARCHAR},#{province,jdbcType=VARCHAR},#{district,jdbcType=VARCHAR})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(ByUserWedBudget record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_wed_budget
     *
     * @mbggenerated Fri Apr 21 00:08:10 CST 2017
     */
    int insertSelective(ByUserWedBudget record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_wed_budget
     *
     * @mbggenerated Fri Apr 21 00:08:10 CST 2017
     */
    List<ByUserWedBudget> selectByExample(ByUserWedBudgetExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_wed_budget
     *
     * @mbggenerated Fri Apr 21 00:08:10 CST 2017
     */
    @Select({
        "select",
        "id, user_id, wed_type, wed_time, money, mobile, contact, descn, status, create_time, ",
        "update_time, city",
        "from by_user_wed_budget",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    ByUserWedBudget selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_wed_budget
     *
     * @mbggenerated Fri Apr 21 00:08:10 CST 2017
     */
    int updateByExampleSelective(@Param("record") ByUserWedBudget record, @Param("example") ByUserWedBudgetExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_wed_budget
     *
     * @mbggenerated Fri Apr 21 00:08:10 CST 2017
     */
    int updateByExample(@Param("record") ByUserWedBudget record, @Param("example") ByUserWedBudgetExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_wed_budget
     *
     * @mbggenerated Fri Apr 21 00:08:10 CST 2017
     */
    int updateByPrimaryKeySelective(ByUserWedBudget record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_wed_budget
     *
     * @mbggenerated Fri Apr 21 00:08:10 CST 2017
     */
    @Update({
        "update by_user_wed_budget",
        "set user_id = #{userId,jdbcType=INTEGER},",
          "wed_type = #{wedType,jdbcType=VARCHAR},",
          "wed_time = #{wedTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler},",
          "money = #{money,jdbcType=VARCHAR},",
          "mobile = #{mobile,jdbcType=VARCHAR},",
          "contact = #{contact,jdbcType=VARCHAR},",
          "descn = #{descn,jdbcType=VARCHAR},",
          "status = #{status,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler},",
          "city = #{city,jdbcType=VARCHAR}",
          "province = #{province,jdbcType=VARCHAR}",
          "district = #{district,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ByUserWedBudget record);
}